54350cd09e696d234b30b8cd1c5561438b68073f,maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java,DescribeMojo,lookupPluginDescriptor,#PluginInfo#,389

Before Change


            descriptor = pluginManager.getPluginDescriptorForPrefix( pi.getPrefix() );
            if ( descriptor == null )
            {
                forLookup = pluginManager.getPluginDefinitionForPrefix( pi.getPrefix(), session, project );
            }
        }
        else if ( StringUtils.isNotEmpty( pi.getGroupId() ) && StringUtils.isNotEmpty( pi.getArtifactId() ) )

After Change


            }
            catch ( NoPluginFoundForPrefixException e )
            {
                throw new MojoExecutionException( "Unable to find the plugin with prefix: " + pi.getPrefix(), e );
            }
        }
        else if ( StringUtils.isNotEmpty( pi.getGroupId() ) && StringUtils.isNotEmpty( pi.getArtifactId() ) )
        {
            forLookup = new Plugin();
            forLookup.setGroupId( pi.getGroupId() );
            forLookup.setArtifactId( pi.getArtifactId() );
        }
        if ( forLookup == null )
        {
            String msg =
                "You must specify either: both 'groupId' and 'artifactId' parameters OR a 'plugin' parameter"
                  + " OR a 'cmd' parameter. For instance:" + LS
                  + "  # mvn help:describe -Dcmd=install" + LS
                  + "or" + LS
                  + "  # mvn help:describe -Dcmd=help:describe" + LS
                  + "or" + LS
                  + "  # mvn help:describe -Dplugin=org.apache.maven.plugins:maven-help-plugin" + LS
                  + "or" + LS
                  + "  # mvn help:describe -DgroupId=org.apache.maven.plugins -DartifactId=maven-help-plugin" + LS + LS
                  + "Try 'mvn help:help -Ddetail=true' for more information.";
            throw new MojoFailureException( msg );
        }

        if ( StringUtils.isNotEmpty( pi.getVersion() ) )
        {
            forLookup.setVersion( pi.getVersion() );
        }
        else
        {
            try
            {
                PluginVersionResult versionResult =
                    pluginVersionResolver.resolve( new DefaultPluginVersionRequest( forLookup, session ) );
                forLookup.setVersion( versionResult.getVersion() );
            }
            catch ( PluginVersionResolutionException e )
            {
                throw new MojoExecutionException( "Unable to resolve the version of the plugin with prefix: "
                    + pi.getPrefix(), e );
            }
        }